﻿Imports Telerik.Web.UI

Partial Public Class WebForm4
    Inherits System.Web.UI.Page
    Dim blo

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub


    Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand

        SqlDataSource1.DeleteParameters("ID1").DefaultValue = e.Item.Cells(2).Text

    End Sub

    Protected Sub SqlDataSource1_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles SqlDataSource1.Updating

    End Sub


    Protected Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.EditCommand
        Session("id") = e.Item.Cells(2).Text
        Dim dd = TryCast(RadGrid1.FindControl("testdd"), DropDownList)
        dd.Items.add("rot")
    End Sub

    Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)

        Dim LastName As String = (TryCast(editedItem("name").Controls(0), TextBox)).Text

        SqlDataSource1.UpdateParameters("id").DefaultValue = Session("id")
        SqlDataSource1.UpdateParameters("name").DefaultValue = LastName
    End Sub


End Class